package miniproj.models.people;

import java.util.*;

import miniproj.models.groups.Teaching;

public class Teacher extends Person implements java.io.Serializable {

	private static final long serialVersionUID = 3342442025380529857L;

	/**
	 * Instantiates a new teacher.
	 */
	public Teacher() {
		super();
	}

	/**
	 * Instantiates a new teacher.
	 * 
	 * @param firstName
	 *            the first name of the teacher
	 * @param lastName
	 *            the last name of the teacher
	 */
	public Teacher(String firstName, String lastName) {
		super(firstName, lastName);
	}

	/**
	 * Gets the teachings.
	 * 
	 * @param allTeachings
	 *            the list of the teachings
	 * @return the teachings taught by this teacher
	 */
	public LinkedList<Teaching> getTeachings(List<Teaching> allTeachings) {
		LinkedList<Teaching> toReturn = new LinkedList<Teaching>();

		for (Teaching t : allTeachings)
			if (t.getHeadTeacher().equals(this))
				toReturn.add(t);

		return toReturn;
	}
}
